This invention relates generally to computer systems and, more particularly, to a system and method for performing multi-texturing operations using recursive interleaving.
Graphics textures add shading or other attributes to the surface of a graphics object, giving the object a realistic appearance. Computer systems perform texturing operations to map a graphics texture onto the graphics object. Multi-texturing involves mapping multiple textures onto the same graphics object. Multi-texturing is commonly used in computer games and other applications to produce high-quality graphics.
Multi-texturing often involves graphics images that are composed of many graphics primitives. Graphics primitives are shapes such as points, lines, circles, curves, or polygons that can be drawn, stored, and/or manipulated as discrete entities by a graphics program. Each graphics primitive may comprise one or more graphics fragments, which are small portions of a graphics primitive. Each fragment may, for example, comprise four pixels of a primitive. Multi-texturing operations are typically performed on the graphics fragments.
For each graphics fragment, the system produces a texel associated with a texture being mapped onto the fragment. The texel, or texture element, defines how a texture would appear when mapped onto the graphics fragment. If the system is mapping three textures onto a graphics object, for example, three texels are generated for each fragment. The system then maps each texture onto the graphics fragment by combining the fragment with each texel.
Computer systems have conventionally used multiple separate texture generation pipelines to produce these multiple texels. The first texture generation pipeline receives a graphics fragment and produces a texel for the first texture. The second texture generation pipeline receives the same graphics fragment and produces a texel for the second texture. The system then typically combines the graphics fragment with the texels one at a time.
A problem with this approach is that increasing the number of texture generation pipelines has conventionally resulted in an increase of the amount of hardware needed in the system. The use of separate texture generation pipelines for two or more texture operations increases the amount of hardware, which takes up space in and increases the expense of the system. Also, the texture generation pipelines share the same memory. As the number of pipelines increases, each pipeline""s share of the memory decreases. The pipelines may be unable to perform some tasks if the memory requirements for those tasks exceed one pipeline""s share of the memory.
In addition, the system typically processes only one graphics fragment at a time. The system combines the graphics fragment and the first texel, and then combines the result with the second texel. The system is unable to process multiple fragments at the same time, resulting in a higher system latency. The high latency may prevent the system from producing high-quality graphics in some applications. Typical images are comprised of many graphics primitives, and each primitive may be comprised of many graphics fragments. In games or other applications where graphics often change quickly, the system may be unable to process all of the fragments fast enough. The resulting image may lack some or all of the detail that would ordinarily appear if processing had been completed.
The present invention recognizes a need for an improved method and system for performing multi-texturing operations using recursive interleaving and seeks to reduce or eliminate at least some of the shortcomings of prior systems and methods.
In accordance with one aspect of the present invention, a system for performing multi-texturing operations comprises a texture generation pipeline operable to receive a first graphics fragment and a second graphics fragment, to generate a first plurality of texels corresponding to the first fragment, and to generate a second plurality of texels corresponding to the second fragment. The system also comprises a color pipeline coupled to the texture generation pipeline. The color pipeline is operable to receive the first and second graphics fragments and the first and second plurality of texels, and to generate a first color value for the first fragment and a second color value for the second fragment. The color pipeline is also operable to combine the first color value and the first plurality of texels, and to at least begin combining the second color value and the second plurality of texels during the combination of the first color value and the first plurality of texels.
Numerous technical advantages can be gained through various embodiments of the invention. Various embodiments of the invention may exhibit none, some, or all of the following advantages. Technical advantages of the present invention include the ability to produce texels for multiple textures using fewer texture generation pipelines. The use of fewer texture generation pipelines reduces the amount of hardware used by the system, reducing both the physical space occupied by the hardware and the expense of the system.
Another technical advantage of the present invention is the ability of the system to perform multi-texturing operations requiring large amounts of memory. By using fewer texture generation pipelines, the memory dedicated to each pipeline is greater. This reduces the likelihood that a graphics operation will exceed the memory capacity of the system.
A further advantage is the ability to process multiple graphics fragments at or near the same time. The invention allows multiple fragments to be combined with multiple texels without requiring complete processing of each fragment before beginning the next. The invention facilitates interleaving of the fragments to reduce system latency by allowing the system to perform overlapping multi-texturing operations. Since the system can process multiple graphics fragments at or near the same time, processing delay can be reduced, increasing the efficiency of the system.
The ability to perform more multi-texturing operations in a given time period allows the system to create higher quality graphics images than would otherwise be possible. The system may map textures onto the graphics objects faster, giving the system more time to perform other operations. Using this additional time, the system could, for example, map additional textures onto the same graphics object.
In addition, the ability to produce multiple texels for each graphics fragment and to recursively combine the texels and the graphics fragments allows any number of textures to be quickly mapped onto the fragments. The system may not be limited to a certain number of textures based on the number of texture generation pipelines provided in hardware.
The present invention may or may not accomplish all of the aforementioned advantages, depending on the particular details and inventive features implemented in a given embodiment. Particular embodiments implementing some of the inventive features may exhibit some, but not all, of the aforementioned advantages. Other embodiments may be constructed to realize all of the advantages discussed above. The absence of any particular advantageous feature is not intended to limit the scope of this invention.
Other technical advantages are readily apparent to one of skill in the art from the attached figures, description, and claims.